1. Technical Field
The present invention relates to a disk drive apparatus used in a hard disk drive (HDD), etc., and control method therefor, and relates in particular to a disk drive apparatus for high-speed data transfer in a multi-drive environment, and control method therefor.
2. Description of the Related Art
In order to increase access speed, a hard disk drive (HDD) used as an auxiliary storage device for information processing equipment is generally provided with cache memory that temporarily holds data supplied from the information processing equipment (referred to below as the host), or that temporarily holds data read from the magnetic disk until it is transferred to the host, and a controller that performs cache control.
When write data is supplied from the host, the controller holds the supplied write data in the cache memory, then releases the host from write processing. In parallel with this, the controller performs write-system control in which the write data held in the cache memory is sequentially written to the magnetic disk (referred to below as the medium). Also, when there is a read request from the host, the controller instructs the read system to read the expected data from the medium, and holds the data that is read in the cache memory. Then, when there is a read request from the host, if the data to be read is held in the cache memory, it is supplied to the host. By performing this kind of cache control, the apparent access speed of the HDD is increased.
In the small HDDs of recent years, the trend is to use a technique for minimizing the intervention of the HDD""s microprocessor (referred to below as the local MPU) in host interface peripheral processing as a means of improving performance by decreasing command overhead, and using hardware implementation of this processing by the host interface controller (HIC) as much as possible.
One possible technique of this kind is the use of a system in which data transfer between the host and cache memory can be performed under HIC control without local MPU intervention, while data transfer between the medium and cache memory requires intervention by the local MPU, which performs data transfer by controlling the hard disk controller (HDC).
The operation for writing data to the medium by means of a write command from the host in this kind of system will be described below.
(1) Once data from the host enters the cache memory via the HIC, the HIC informs the local MPU that a command has arrived from the host. On receiving this information, the local MPU issues an instruction to the HDC to write data in the cache memory to the medium. In response to this instruction, the HDC transfers cache memory data to the medium, and the data is written to the medium.
(2) After this, the HIC issues a notification to the local MPU indicating that transfer to the cache memory from the host has finished, and the HDC issues a notification indicating that writing to the medium has finished.
The operation of the HIC and the local MPU will now be described in greater detail. When the HIC receives a command from the host, it immediately starts data transfer to the cache memory without the intervention of the local MPU, and notifies the local MPU. When this data transfer ends, and as soon as there is space (for example, one block) allowing the next write command to be received in the cache memory, the HIC notifies the local MPU of the end of the command. This notification is to enable the next write command to be latched in the cache memory as soon as it arrives, and is an IDE (Integrated Device Electronics) interface specification.
In this kind of operation, when there is enough space in the cache memory, the HIC independently gives the host an end notification without regard to write processing operations by the local MPU, accepts the next write command from the host, and performs data transfer based on the next write command. Latching as many write commands as possible in the cache memory in this way enables performance to be further improved. In order to perform the above operations, a command queue is provided in the cache memory to hold the various kinds of cache memory commands.
FIG. 9 is a drawing showing the structure of the cache memory command queue. In FIG. 9, Q=1, 2, . . . , n are queue addresses, and A, B, C, D, . . . , N are commands held in the cache memory. As shown in FIG. 9, commands cached in the cache memory are written in the command queue as A, B, . . . , in order, starting with the oldest command. Queue addresses increase each time a command is accepted, and decrease when the old commands are executed sequentially. Command queue management is performed by the HIC, and the local MPU can take in queue address commands.
Write commands held in the command queue are executed by the HDC in response to a write directive from the local MPU to the HDC, and are written to the medium. Data read from the medium is transferred to the cache memory by the HDC, and then transferred to the host by the HIC.
The disk drive apparatus is provided with memory called a sector buffer, and in order to speed up sequential reads, even though an area read requested by one read command ends, the following area read is proceeded with (xe2x80x9clook-aheadxe2x80x9d). Thus, in the case of sequential reads, data is already present in the cache memory when the next read command arrives, enabling higher speed to be achieved. The serial number assigned to a usable sector is called the LBA (logical block address).
Also, a hard disk apparatus generally has a xe2x80x9creorderxe2x80x9d function that rearranges the execution order of queued commands in order to minimize read/write head movement. The hard disk apparatus places commands received from the host in a queue, and changes the command execution order so that this command list is executed most efficiently and speedily on the logical unit.
That is to say, when data read/writes for multiple sectors are issued to the hard disk apparatus from the host, if sectors were read in the order in which the commands are issued, the head would make numerous two-way moves on the disk, which would be time consuming. Therefore, the order of the commands is changed so as to read/write the sectors according to a schedule that minimizes the amount of head movement. In this case, a schedule is established that takes account not only of the amount of head movement, but also of disk latency and head switching time. The schedule that decides this command order is determined by RPO (rotational position optimization).
FIG. 10 is a block diagram showing the configuration of a hard disk apparatus including the software (microprogram) that implements the above described command processing.
In FIG. 10, reference numeral 1 denotes the host interface controller (HIC); reference numeral 2 denotes a drive apparatus that controls HDD drive operations, including control of the voice coil motor (VCM) that drives the actuator mechanism and of the hard disk controller (HDC); reference numeral 3 denotes the interface event handler (I/F event handler); reference numeral 4 denotes the queue handler; reference numeral 5 denotes the command handler (Cmd handler); and reference numeral 6 denotes the drive event handler.
The HIC 1 and the drive apparatus 2 are configured by means of hardware. The interface event handler 3, queue handler 4, command handler 5, and drive event handler 6 are control routines that have functions determined by the microprogram, and are executed by the MPU.
The interface event handler 3 processes events from the HIC 1, and conveys those events to the queue handler 4 or command handler 5. When the HIC 1 receives a command, it stores it in a queue area.
When a number of commands are stored in the queue area, the queue handler 4 performs reordering so that the command list is executed most efficiently and speedily, and determines the command to be executed by the command handler 5. Thereafter, the queue handler 4 requests the command handler 5 to execute the determined command. When the command has been executed by the command handler 5, if there is another command to be executed, the command handler 5 is requested to execute that command.
The command handler 5 executes commands for which execution is requested by the queue handler 4, issues drive apparatus 2 read/write requests to the drive apparatus 2, and issues interface (I/F) control requests to the HIC 1. In this way, the command handler 5 processes drive and I/F related events.
The drive event handler 6 processes events from the HDC of the drive apparatus 2, and conveys events to the command handler 5.
Next, command processing by the above described microprogram will be described.
FIG. 11 is a flowchart showing the control routine of the queue handler 4 in the above described microprogram. Reference characters ST in the figure denote an individual processing step.
First, in step ST1 it is judged whether or not there are commands awaiting execution in the queue area. If there are commands awaiting execution, reordering is performed in step ST2 so that the command list is executed most efficiently and speedily, and then the routine proceeds to step ST3.
If there are no commands awaiting execution, or when reordering has been performed, the command handler 5 judges in step ST3 whether there is a command that is being executed. If a command is being executed, the routine goes back to step ST1; if no command is being executed, the routine proceeds to step ST4.
In step ST4, it is judged whether or not the command to be executed has been determined. If the command to be executed has not been determined, the routine goes back to step ST1. If the command to be executed has been determined, a command execution request is made to the command handler 5 in step ST5, and the routine goes back to step ST1.
FIG. 12 is a flowchart showing the control routine of the command handler 5 in the above described microprogram.
The program starts at the start of command execution. First, in step ST11 it is judged whether or not there is an interface related event (I/F event), and if there is an I/F event, I/F event processing is performed in step ST12, and the routine proceeds to step ST13.
If there is no I/F event, or when I/F event processing has been performed, in step ST13 it is judged whether or not there is a drive related event (drive event), and if there is a drive event, drive event processing is performed in step ST14, and the routine proceeds to step ST15.
If there is no drive event, or when drive event processing has been performed, in step ST15 it is judged whether or not all I/F and drive processing has ended. If all I/F and drive processing has not ended, the routine goes back to step ST11 and the above described processing is repeated; if all I/F and drive processing has ended, processing of this command is ended.
The queued random operations of a hard disk apparatus that has the above described configuration will now be described below. In these queued random operations, the order of commands to be executed is determined by RPO.
FIGS. 13 to 16 are drawings showing the timing of interface-side and drive-side command processing and transfer in queued random operations. Of the queued random operations, FIGS. 13 and 14 show read operations, and FIGS. 15 and 16 show write operations. Also, FIGS. 13 and 15 show operations in a single-drive environment in which a single hard disk apparatus is connected to the host via a SCSI (Small Computer System Interface) bus, while FIGS. 14 and 16 show operations in a multi-drive environment in which a plurality of hard disk apparatuses are connected to the host.
FIG. 17 is a drawing to explain a hard disk apparatus multi-drive environment; FIG. 17A shows the case where a single hard disk apparatus is connected to the host via a bus, and FIG. 17B shows a multi-drive environment in which a plurality of hard disk apparatuses are connected to the host via a SCSI bus. In FIG. 17, SCSI2, an extended SCSI, is used. FIG. 17B shows a multi-drive environment in which hard disk apparatuses are connected; peripheral devices connected to SCSI2 may also include CD-R drives and MO drives, for example. Data read/write operations are performed between any of these disk apparatuses and the host via the SCSI2 bus.
Also, if RAIDs (redundant arrays of inexpensive disks) are provided with the host as a server, a plurality of hard disk drive apparatuses are connected, and appear to be a single drive. This kind of disk array control method is described in Published Unexamined Patent Application No. 5-289818 and National Publication of International Patent Application No. 8-501643.
Current queued random operations are processed as shown in FIGS. 13 to 16.
When the host makes a request for data transfer to the drive-side, as shown in the read operation in FIG. 13, in the drive-side processing the command 1 (CMD1) data after queuing is the object of a seek, and is read from the disk and stored in a buffer; then this read data is sent to the host by data transfer in the interface (I/F)-side processing (see FIG. 13a.), and the CMD1 data read ends. The host issues a new command (here, CMDm) (see FIG. 13b.).
Regarding the next command, as reordering has ended and a new command (here, CMD2) has been decided, the command 2 (CMD2) data after queuing is the object of a seek, and is read from the disk and stored in a buffer (see FIG. 13c.); then this read data is sent to the host by data transfer in the interface (I/F)-side processing. The RPO algorithm is designed on the basis of a predetermined time from the end of CMD1 until the CMD2 seeks begin.
Thus, in a read operation, if only one hard disk drive apparatus is connected to the bus, data transfer is performed smoothly, and a series of commands are completed within the time predicted by RPO.
Also, as shown in the write operation in FIG. 15, in the case of writes, unlike the above described read operation, writing is not possible unless data arrives. Also, status and message (status and MSG) confirmation is involved.
On the drive side, if execution of command 1 (CMD1) is performed internally, data is required for CMD1 execution, so a reselection or xe2x80x9creselxe2x80x9d is applied to the host side (see FIG. 15a.). As this is a write reselection or xe2x80x9creselxe2x80x9d, data from the host is transferred (see FIG. 15b.), on the drive side a seek of the transferred data is performed, and after a latency wait, the data is written to the disk (see FIG. 15c.). When data writing ends, a command end status and status message are sent to the host as shown in FIG. 15d. 
The host issues a new command (here, CMDn) (see FIG. 15e.). Reordering for the next command ends and a new command (here, CMD2) is decided.
Thus, in a write operation, if only one hard disk drive apparatus is connected to the bus, data transfer is performed smoothly, and a series of commands are completed within the time predicted by RPO.
However, with hard disk drive apparatuses that employ a technique for performing conventional queued random operations of this kind, there are limitations on improvement of performance for the reasons given below.
That is to say, if only one hard disk drive apparatus is connected to the bus, as shown in FIG. 17A, data transfer is performed smoothly, and a series of commands are completed within the time predicted by RPO, as illustrated in FIGS. 13 and 15. However, if two or more hard disk drive apparatuses are connected to the bus, as shown in FIG. 17B, it is not always possible for data transfer to start immediately, and a latency arises, causing a drop in performance. This problem will be described in detail below with reference to FIGS. 14 and 16.
FIG. 14 is a chart showing read operations in a multi-drive environment in which two or more hard disk apparatuses are connected to the SCSI bus; other conditions are the same as in the single-drive environment in above mentioned FIG. 13.
As shown in the read operations in a multi-drive environment in FIG. 14, if the bus is not free when data read from the disk by command 1 (CMD1) on the drive side is about to start being transferred by CMD1 on the interface side, CMD1 data transfer will be delayed by time A (see FIG. 14a.), the interval before the bus becomes free. As a result, the start of drive-side processing of the next command, CMD2, is delayed by time A due to the wait for the end of CMD1 interface-side processing, as shown in FIG. 14b. As RPO determines the order of command processing so that the latency will be 0, the delayed start of drive processing causes one-revolution latency (1REV.) as shown in FIG. 14c. 
That is to say, the RPO algorithm is designed on the assumption that data transfer will be possible immediately when it is time for it to begin, and therefore, if there is even a slight delay in interface-side data transfer, this slight delay, time A, on the drive side will prevent execution of the next command (seek and read) from being carried out in time, and one-revolution latency will arise in command processing.
A similar problem also occurs in write operations in a multi-drive environment.
FIG. 16 is a chart showing write operations in a multi-drive environment in which two or more hard disk apparatuses are connected to the SCSI bus; other conditions are the same as in the single-drive environment in above mentioned FIG. 15.
As shown in the write operations in a multi-drive environment in FIG. 16, if the bus is not free when data transfer is about to be started by command 2 (CMD2) on the interface side, CMD2 data transfer will not be possible, and will be delayed by time B (see FIG. 16a), the interval before the bus becomes free. As a result, the start of drive-side processing of command CMD2 is delayed by time B due to the wait for the end of CMD2 interface-side processing (storage in the buffer of the data to be written), as shown in FIG. 16b. As RPO determines the order of command processing so that the latency will be 0, the delayed start of interface processing causes one-revolution latency (1REV.) as shown in FIG. 16b. 
In a multi-drive environment, as described above, if, when a particular hard disk drive apparatus is not using the bus, another hard disk drive apparatus is using the bus, it is not possible to use the bus immediately, and latencies A and B shown in the above described FIGS. 14 and 16 will arise. The order of command execution in queued random operations is determined by RPO, but as RPO does not take account of cases where the bus cannot be used, there is a problem in that, if the above described unpredicted latency occurs, excessive latency will be incurred in command processing. Moreover, it is not possible to predict to what extent it will not be possible to use the bus, because of the operation of other hard disk drive apparatuses. In addition, peripheral devices that can be connected to a SCSI bus include various kinds of devices other than hard disk drive apparatuses, and a similar problem will occur when these devices use the bus.
The present invention has as its object the provision of a disk drive apparatus and its control method that prevent the latency that may occur in a multi-drive environment, and improve performance.
The disk drive apparatus of the present invention comprises: a drive controller that controls operations such as reading/writing or the like of data from/to a disk-shaped storage medium; a host interface controller that performs data transfer between the host and the drive controller by means of hardware; and a command manager that stores in a queue area a plurality of commands issued by the host, performs reordering so that a command list is executed most efficiently and speedily, determines the command to be executed, and requests execution of the determined command; and further comprises: interface processing means that executes interface-side processing including data transfer between the host and the drive controller by means of commands for which execution has been requested; and drive processing means that executes drive-side processing by means of commands for which execution has been requested, and issues requests to the drive controller for reading/writing related to command execution; wherein interface-side processing and drive-side processing are performed separately with regard to command processing.
The disk drive apparatus of the present invention may be an apparatus wherein interface-side processing and drive-side processing are separated with regard to command processing, and interface-side processing does not affect the start of drive-side processing.
The disk drive apparatus of the present invention may be an apparatus wherein, when the interface processing means is about to execute interface-side processing according to a first command, the drive processing means starts processing of a second command at the end of drive-side processing of the first command, without regard to execution of processing by the interface processing means.
The disk drive apparatus of the present invention may be an apparatus comprising a plurality of cache segment buffers that store data read from a disk-shaped storage medium by execution of a plurality of commands; wherein the drive processing means stores data read from the disk-shaped storage medium by command execution in a plurality of cache segment buffers, and executes drive-side processing; and the interface processing means executes interface-side processing on data stored in a plurality of cache segment buffers.
The disk drive apparatus of the present invention may be an apparatus comprising a plurality of cache segment buffers that store data to be written to a disk-shaped storage medium by execution of a plurality of commands; wherein the interface processing means starts data transfer to a plurality of cache segment buffers without regard to the processing situation of the drive processing means; and the drive processing means writes write data, that has been transferred to a plurality of cache segment buffers, to the disk-shaped storage medium by means of command execution, and executes drive-side processing.
The disk drive apparatus of the present invention may be an apparatus comprising a plurality of cache segment buffers that store data to be written to a disk-shaped storage medium by execution of a plurality of commands; wherein the interface processing means starts data transfer to a plurality of cache segment buffers without regard to the command processing order determined by the command manager; and the drive processing means writes write data, that has been transferred to a plurality of cache segment buffers, to the disk-shaped storage medium in the command processing order determined by the command manager, and executes drive-side processing.
The interface-side processing executed by the above described interface processing means may be data transfer, and the drive-side processing executed by the above described drive processing means may be read/write processing on a disk-shaped storage medium.
Further, the drive-side processing executed by the above described drive processing means may be processing to write data to a plurality of cache segment buffers, or processing to read data from a plurality of cache segment buffers.
The disk drive apparatus of the present invention may be an apparatus wherein a plurality of commands issued by the host are stored in a queue area, and queued random operations that execute commands are performed.
The disk drive apparatus of the present invention may be an apparatus wherein a plurality of commands issued by the host are stored in a queue area, and queued random operations that execute commands are performed; and the order of the commands executed in the queued random operations is determined by RPO that changes the command execution order so that the command list is executed most efficiently and speedily.
The disk drive apparatus of the present invention may be a disk-drive apparatus that is used in a multi-drive environment, wherein the host and a plurality of peripheral devices are connected by a bus, and data transfer is performed between the host and a peripheral device, or between peripheral devices, by occupying the bus; and the peripheral devices are disk drive apparatuses according to claim 1.
A disk drive apparatus control method of the present invention comprises: a command manager that stores in a queue area a plurality of commands issued by the host, performs reordering so that the command list is executed most efficiently and speedily, determines the command to be executed, and requests execution of the determined command; interface processing means that executes interface-side processing by means of commands for which execution has been requested; and drive processing means that executes drive-side processing by means of commands for which execution has been requested; and comprises, in the queued random read operation that executes read commands: a step in which the drive processing means executes first command processing on the drive side; a step in which, at the end of drive-side first command processing, the interface processing means executes interface-side processing by means of the first command; and a step in which the drive processing means starts second command processing at the end of first command drive-side processing, without regard to execution of first command processing by the interface processing means.
A disk drive apparatus control method of the present invention comprises: a command manager that stores in a queue area a plurality of commands issued by the host, performs reordering so that the command list is executed most efficiently and speedily, determines the command to be executed, and requests execution of the determined command; interface processing means that executes interface-side processing by means of commands for which execution has been requested; and drive processing means that executes drive-side processing by means of commands for which execution has been requested; and comprises, in the queued random read operation that executes read commands: a step in which the drive processing means stores data read from a disk-shaped storage medium by command execution in a plurality of cache segment buffers, and executes drive-side processing; a step in which the interface processing means executes interface-side processing on data stored in a plurality of cache segment buffers; and a step in which the drive processing means sequentially executes processing of the next command without regard to execution of interface-side processing by the interface processing means.
A disk drive apparatus control method of the present invention comprises: a command manager that stores in a queue area a plurality of commands issued by the host, performs reordering so that the command list is executed most efficiently and speedily, determines the command to be executed, and requests execution of the determined command; interface processing means that executes interface-side processing by means of commands for which execution has been requested; and drive processing means that executes drive-side processing by means of commands for which execution has been requested; and comprises, in the queued random write operation that executes write commands: a step in which the interface processing means starts data transfer to a plurality of cache segment buffers without regard to the processing situation of the drive processing means; a step in which the drive processing means writes write data, that has been transferred to a plurality of cache segment buffers, to a disk-shaped storage medium by means of command execution, and executes drive-side processing; and a step of sending a command end status to the host when writing to the disk-shaped storage medium by means of command execution ends.
A disk drive apparatus control method of the present invention comprises: a command manager that stores in a queue area a plurality of commands issued by the host, performs reordering so that the command list is executed most efficiently and speedily, determines the command to be executed, and requests execution of the determined command; interface processing means that executes interface-side processing by means of commands for which execution has been requested; and drive processing means that executes drive-side processing by means of commands for which execution has been requested; and comprises, in the queued random write operation that executes write commands: a step in which the interface processing means starts data transfer to a plurality of cache segment buffers without regard to the command processing order determined by the command manager; a step in which the drive processing means writes write data, that has been transferred to a plurality of cache segment buffers, to a disk-shaped storage medium in the command processing order determined by the command manager, and executes drive-side processing; and a step of sending a command end status to the host when writing to the disk-shaped storage medium by means of command execution ends.